import {
  parentMenu
} from '@/api/menu'

const state = {
  menus: [],
}

const mutations = {
  set_parent_menu(state, list) {
    state.menus = list;
  }
}

const actions = {
  getParentMenu({
    commit
  }) {
    parentMenu().then(res => {
      if (res.data) {
        
        commit('set_parent_menu', res.data);
      }
    })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
